home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 2.iso / dist / fw_licq.idb / usr / freeware / bin / viewurl-netscape.sh.z / viewurl-netscape.sh
Linux/UNIX/POSIX Shell Script  |  2002-04-08  |  887b  |  44 lines

  1. #!/bin/sh
  2. #
  3. # Brian Hunt ( bmh at canada.com ), December 1999
  4. #
  5. # set NETSCAPE to your netscape binary.
  6. # set URLHOME to your default homepage.
  7. # --
  8. # (): Open new window, at:
  9. #     (1) specified link
  10. #    (2) home page given in URLHOME
  11. # Conditions of execution:
  12. # Netscape lock file exists (~/.netscape/lock):
  13. #    (1) netscape running
  14. #     -> Open new window
  15. #    (2) netscape not running
  16. #        (as per `ps` , which echos netscape's pids)
  17. #      delete ~/.netscape/lock 
  18. #    -> Open new window
  19. # Netscape lockfile does not exist;
  20. #    -> Open new window.
  21. #
  22.  
  23. NETSCAPE=netscape
  24. URLHOME='http://www.linux.org'
  25.  
  26. if [ "$1" = "" ] ; then
  27.   URL=$URLHOME
  28. else
  29.   URL=$1
  30. fi
  31.  
  32. if [ -h ${HOME}/.netscape/lock ]; then
  33.   if ps -e | grep netscape > /dev/null ; then
  34.      ${NETSCAPE} -remote openURL\("$URL"\,new_window\) &
  35.   else
  36.      rm ${HOME}/.netscape/lock
  37.      ${NETSCAPE} "$URL" &
  38.   fi
  39. else
  40.   ${NETSCAPE} "$URL" &
  41. fi
  42.  
  43.  
  44.